<template>
  <div class="premission">
    <el-card shadow="never">
      <div slot="header">
        <span><!-- card title --></span>
      </div>
      <el-table :data="list" border stripe row-key="id">
        <el-table-column
          prop="title"
          label="菜单名称"
          :width="200"
        />
        <el-table-column
          prop="icon"
          label="图标"
        >
          <template slot-scope="scope">
            <i :class="scope.row.icon" />
          </template>
        </el-table-column>
        <el-table-column
          prop="level"
          label="等级"
        />
        <el-table-column
          prop="sort"
          label="排序"
        />
        <el-table-column
          prop="premissionValue"
          label="权限标识"
        />
        <el-table-column
          prop="path"
          label="路由"
        />
        <el-table-column
          prop="component"
          label="组件路径"
        />
        <el-table-column
          prop="status"
          label="是否可用"
        />
        <el-table-column
          prop="createTime"
          label="创建时间"
        />
      </el-table>

    </el-card>

  </div>
</template>
<script>
import { findAllPermissions } from '@/api/auth/permission/index'
export default {
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const { success, message, data } = await findAllPermissions()
      if (success) {
        this.list = data.menus
      } else {
        this.$message.error(message)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.premission {
  margin: 30px;
}
</style>
